﻿<UserControl x:Class="Smokey.Client.Screens.Applications.ViewApplication"
             x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="*"/>
            <RowDefinition
                Height="*"/>
            <RowDefinition
                Height="20"/>
            <RowDefinition
                Height="*"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition
                Width="*"/>
            <ColumnDefinition
                Width="100"/>
            <ColumnDefinition
                Width="Auto"/>
        </Grid.ColumnDefinitions>

        <StackPanel 
              Orientation="Vertical"
              Grid.Row="1">
            <TextBlock
    			Text="APPLICATION DETAILS"
    			Style="{StaticResource TitleStyle}"
                Height="40"/>

            <TextBlock
    			Text="Application Name"
    			Style="{StaticResource LabelStyle}"
                Height="25"
                SnapsToDevicePixels="True"/>

            <TextBox
    			Text="{Binding Application.ApplicationName}"
    			Style="{StaticResource MetroTextBox}"
                Height="25"
                Width="300"
                HorizontalAlignment="Left"
                Margin="0,0,0,10"
                />

            <TextBlock
    			Text="Location"
    			Style="{StaticResource LabelStyle}"
                Height="25"/>
            <StackPanel 
                Margin="0,0,0,0"
                Orientation="Horizontal">
                <TextBox
            		Text="{Binding Application.Location}"
            		Style="{StaticResource MetroTextBox}"
            		Height="25"
            		Width="300"
            		HorizontalAlignment="Left"
            		Margin="0,0,0,10"/>
                <Button
                	Content="Browse"
                	Style="{StaticResource ButtonStyle}"
                	HorizontalAlignment="Left" 
                	Margin="10,0,0,10"
                    Click="BrowseButton_Click"/>
                <Button
            		Content="Test Application"
            		Style="{StaticResource ButtonStyle}"
            		HorizontalAlignment="Left" 
                    Margin="10,0,0,10"/>
            </StackPanel>

            <TextBlock
    			Text="Email"
    			Style="{StaticResource LabelStyle}"
                Height="25"/>

            <TextBox
    			Text="{Binding Application.Email}"
    			Style="{StaticResource MetroTextBox}"
                Height="25"
                Width="300"
                HorizontalAlignment="Left"
                Margin="0,0,0,10"/>

        </StackPanel>
        <StackPanel
            Orientation="Vertical"
            Grid.Row="3"
            Visibility="{Binding CanScheduleRuns, Converter={StaticResource BooleanToVisibilityConverter}}">

            <TextBlock
        		Text="SCHEDULED RUNS"
        		Style="{StaticResource TitleStyle}"
                Height="40"/>

            <TextBlock
        		Text="Start Date"
        		Style="{StaticResource LabelStyle}"
                Height="25"/>

            <DatePicker
        		Text="{Binding Application.StartDate}"
                Height="25"
                Width="300"
                HorizontalAlignment="Left"
                Margin="0,0,0,10"/>

            <TextBlock
        		Text="End Date"
        		Style="{StaticResource LabelStyle}"
                Height="25" />

            <DatePicker
        		Text="{Binding Application.EndDate}"
                Height="25"
                Width="300"
                HorizontalAlignment="Left"
                Margin="0,0,0,10"/>

            <TextBlock
        		Text="No. Of Iterations"
        		Style="{StaticResource LabelStyle}"
                Height="25"
                />

            <TextBox
        		Width="50"
        		Text="{Binding Application.NoOfIterations}"
        		Style="{StaticResource MetroTextBox}"
                Height="25"
                HorizontalAlignment="Left"
                Margin="0,0,0,10"/>

        </StackPanel>

        <StackPanel
    		Grid.Row="0"
    		Grid.Column="2"
    		HorizontalAlignment="Right"
    		Orientation="Horizontal" Width="255">

            <Button
    			Content="Save"
    			Margin="0,0,10,0"
    			Style="{StaticResource ButtonStyle}"
                Click="SaveButton_Click"/>

            <Button
    			Content="Delete"
    			Margin="0,0,10,0"
    			Style="{StaticResource ButtonStyle}"/>

            <Button
    			Content="Results"
    			Margin="0,0,10,0"
    			Style="{StaticResource ButtonStyle}"/>

            <Button
    			Content="Run Test Now"
    			Margin="0,0,10,0"
    			Style="{StaticResource ButtonStyle}"/>
        </StackPanel>
    </Grid>
</UserControl>
